#include "aboutdialog.h"
#include "ui_aboutdialog.h"

aboutDialog::aboutDialog(QWidget *parent) :
    QWidget(parent),
    m_ui(new Ui::aboutDialog)
{
    // test svn 2
    m_ui->setupUi(this);
}

aboutDialog::~aboutDialog()
{
    delete m_ui;
}

void aboutDialog::changeEvent(QEvent *e)
{
    switch (e->type()) {
    case QEvent::LanguageChange:
        m_ui->retranslateUi(this);
        break;
    default:
        break;
    }
}

void aboutDialog::showAbout()
{
    int availableWidth = QApplication::desktop()->availableGeometry().width();
    int availableHeight = QApplication::desktop()->availableGeometry().height();
    int availableLeft = QApplication::desktop()->availableGeometry().left();
    int availableTop = QApplication::desktop()->availableGeometry().top();
    this->setGeometry(availableLeft + (availableWidth - this->size().width()) / 2, availableTop + (availableHeight - this->size().height()) / 2, this->size().width(), this->size().height());
    this->show();
}

void aboutDialog::hideAbout()
{
    this->hide();
}

void aboutDialog::closeEvent(QCloseEvent *event)
{
    hideAbout();
    event->ignore();
}
